package com.tengju.user.application.login.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;

@Data
@ApiModel(value = "LoginDTO", description = "登陆请求参数对象")
@NoArgsConstructor
public class LoginDTO {

    @ApiModelProperty("区号")
    private String areaCode;

    @ApiModelProperty("用户名/手机号")
    @NotNull(message = "用户名/手机号不能为空")
    private String username;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("验证码")
    private String verificationCode;

    @ApiModelProperty("用户类型 1：用户 2：员工")
    @NotNull(message = "用户类型不能为空")
    private Integer userType;

    @ApiModelProperty("登陆方式 1：手机验证码登陆 2：用户名密码登陆")
    @NotNull(message = "登陆方式不能为空")
    private Integer loginType;


    public LoginDTO(@NotNull(message = "用户名/手机号不能为空") String username,
                    String password,
                    @NotNull(message = "用户类型不能为空") Integer userType,
                    @NotNull(message = "登陆方式不能为空") Integer loginType) {
        this.username = username;
        this.password = password;
        this.userType = userType;
        this.loginType = loginType;
    }
}
